Defines a binomial distribution. The binomial distribution describes the probability p of getting k successes in n independent trials.
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| integer(kind=int32), | public | :: | n |
The number of independent trials. |
|||
| real(kind=real64), | public | :: | p |
The success probability for each trial. This parameter must exist on the set [0, 1]. |
Computes the cumulative distribution funtion.
The CDF for a binomial distribution is given as , which is simply the regularized incomplete beta function.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(binomial_distribution), | intent(in) | :: | this |
The binomial_distribution object. |
||
| real(kind=real64), | intent(in) | :: | x |
The value at which to evaluate the function. This parameter is the number k successes in the n independent trials. As such, this parameter must exist on the set [0, n]. |
The value of the function.
Gets the defined range for the distribution.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(binomial_distribution), | intent(in) | :: | this |
The binomial_distribution object. |
The defined range of the probability distributions [0, infinity). As using a value of infinity may cause issue, this routine returns huge(0.0d0) instead.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(binomial_distribution), | intent(in) | :: | this |
Distribution with valid parameters. |
||
| real(kind=real64), | intent(in) | :: | x |
Evaluation point. |
Log probability; zero probability gives -infinity, invalid inputs NaN.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(binomial_distribution), | intent(in) | :: | this |
Distribution with valid parameters. |
||
| real(kind=real64), | intent(in) | :: | x |
Evaluation point; discrete masses require integer-valued x. |
Log density; outside support gives -infinity, invalid inputs give NaN. An integrable density singularity at a support endpoint gives +infinity.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(binomial_distribution), | intent(in) | :: | this |
Distribution with valid parameters. |
||
| real(kind=real64), | intent(in) | :: | x |
Evaluation point. |
Log probability; zero probability gives -infinity, invalid inputs NaN.
Computes the mean of the distribution.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(binomial_distribution), | intent(in) | :: | this |
The binomial_distribution object. |
The mean.
Computes the median of the distribution.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(binomial_distribution), | intent(in) | :: | this |
The binomial_distribution object. |
The median.
Computes the mode of the distribution.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(binomial_distribution), | intent(in) | :: | this |
The binomial_distribution object. |
The mode.
Computes the probability mass function.
The PMF for a binomial distribution is given as .
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(binomial_distribution), | intent(in) | :: | this |
The binomial_distribution object. |
||
| real(kind=real64), | intent(in) | :: | x |
The value at which to evaluate the function. This parameter is the number k successes in the n independent trials. As such, this parameter must exist on the set [0, n]. |
The value of the function.
Recenters the distribution about the supplied value.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(binomial_distribution), | intent(inout) | :: | this |
The binomial_distribution object. |
||
| real(kind=real64), | intent(in) | :: | x |
The value about which to recenter. |
Computes the standardized variable for the distribution.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(distribution), | intent(in) | :: | this |
The distribution object. |
||
| real(kind=real64), | intent(in) | :: | x |
The value of interest. |
The result.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(binomial_distribution), | intent(in) | :: | this |
Distribution with valid parameters. |
||
| real(kind=real64), | intent(in) | :: | x |
Evaluation point; discrete tails include masses strictly above x. |
Probability on [0, 1]; invalid parameters or NaN x give NaN.
Computes the variance of the distribution.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(binomial_distribution), | intent(in) | :: | this |
The binomial_distribution object. |
The variance.